windows permissions fix
authorJoey Hess <joeyh@joeyh.name>
Tue, 7 Jan 2025 20:37:39 +0000 (16:37 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 7 Jan 2025 20:37:39 +0000 (16:37 -0400)
commit43b35f949337da5010d342eb92129b45bc4c6b7a
treec3f1b4368175333fea69779d0afd480d6d4da24a
parent4faf2b7bec631a019a1d55ef4cff54f90b62be52
windows permissions fix

Windows: Fix permission denied error when dropping files that have the
readonly attribute set.

Files coming from a special remote may have had write permission removed
from them. The directory special remote does that. And there are
probably others. So rather than fixing it on the special remote side,
made moveAnnex, on Windows, add back the write bit. This apparently
removes the readonly attribute. See Remote.Directory.removeDirGeneric
which already did the same on windows to allow removing files from the
directory special remote.

The reason that cleanObjectLoc also calls allowWrite is to handle
situations where files have already gotten into git-annex repositories on
Windows with the write bit set. Eg, an older git-annex put them there.
Or perhaps the git-annex repository was populated on some other OS.
Annex/Content.hs
CHANGELOG
doc/bugs/Fails_to_drop_key_on_windows___40__Access_denied__41__.mdwn
doc/bugs/Fails_to_drop_key_on_windows___40__Access_denied__41__/comment_4_8a139e5a44ee9bae5195f46a7a67cfaf._comment [new file with mode: 0644]
doc/bugs/git-remote-annex_doesn__39__t_work_on_Windows___40__perms__41__.mdwn
doc/bugs/git-remote-annex_doesn__39__t_work_on_Windows___40__perms__41__/comment_5_9a591141f1105490f359b58a3b29cd91._comment [new file with mode: 0644]